package com.dlsy.ygj.biz.vindicateData.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dlsy.ygj.biz.vindicateData.IWheelBellGroupinfoBiz;
import com.dlsy.ygj.dao.vindicateData.IWheelBellGroupinfoDAO;
import com.dlsy.ygj.entity.WheelBellGroup;

public class WheelBellGroupinfoBiz implements IWheelBellGroupinfoBiz {

	private IWheelBellGroupinfoDAO wheelBellGroupinfoDAO;
	
	public IWheelBellGroupinfoDAO getWheelBellGroupinfoDAO() {
		return wheelBellGroupinfoDAO;
	}

	public void setWheelBellGroupinfoDAO(
			IWheelBellGroupinfoDAO wheelBellGroupinfoDAO) {
		this.wheelBellGroupinfoDAO = wheelBellGroupinfoDAO;
	}

	public List<WheelBellGroup> findWheelBellGroupByName(String value,int storefrontId) {
		return wheelBellGroupinfoDAO.findByHql("From WheelBellGroup w where w.strorefrontId=? and w.wheelBellGroupName=?", storefrontId,value);
	}

	public void deleteWheelBellGroup(int id) {
		// TODO Auto-generated method stub
		wheelBellGroupinfoDAO.delete(WheelBellGroup.class,id);
	}

	public List<WheelBellGroup> findWheelBellGroupLifeAll(int storefrontId) {
		// TODO Auto-generated method stub
		try {
			return wheelBellGroupinfoDAO.findByProperty(WheelBellGroup.class,"strorefrontId", storefrontId);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public void saveWheelBellGroup(WheelBellGroup wheelBellGroup) {
		// TODO Auto-generated method stub
		 wheelBellGroupinfoDAO.save(wheelBellGroup);
	}

	public void updataWheelBellGroup(WheelBellGroup wheelBellGroup) {
		// TODO Auto-generated method stub
		wheelBellGroupinfoDAO.update(wheelBellGroup);
	}

}
